Research
Security News
Kill Switch Hidden in npm Packages Typosquatting Chalk and Chokidar
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
cabal-core
Advanced tools
Core database, replication, swarming, and chat APIs for cabal.
npm install cabal-core
var Cabal = require('cabal-node')
Create a cabal p2p database using storage storage
, which must be either a
string (filepath to directory on disk) or an instance of
random-access-storage.
key
is a hex string of the key, without any prefixes (like cabal://
).
If this is a new database, key
can be omitted and will be generated.
You can pass opts.db
as a levelup or leveldown instance to use persistent
storage for indexing instead of using memory. For example:
var level = require('level')
var cabal = Cabal(storage, key, { db: level('/tmp/bot.db') })
Returns the local user's key (as a hex string).
Creates a new, live replication stream. This duplex stream can be piped into any transport expressed as a node stream (tcp, websockets, udp, utp, etc).
Call cb()
when the underlying indexes are caught up.
Retrieve a list of all channel names that exist in this cabal.
Emitted when a new channel is added to the cabal.
Returns a readable stream of messages (most recent first) from a channel.
Pass opts.limit
to set a maximum number of messages to read.
Calls fn
with every new message that arrives, regardless of channel.
Calls fn
with every new message that arrives in channel
.
var swarm = require('cabal-core/swarm')
Joins the P2P swarm for a cabal. This seeks out peers who are also part of this cabal by various means (internet, local network), connects to them, and replicates cabal messages between them.
The returned object is an instance of discovery-swarm.
Emitted when you connect to a peer. key
is a hex string of their public key.
Emitted when you lose a connection to a peer. key
is a hex string of their
public key.
Publish message
to your feed. message
must have a type
field set. If not,
it defaults to chat/text
. In general, a message is formatted as
{
type: 'chat/text',
content: {
text: 'hello world',
channel: 'cabal-dev'
}
}
A timestamp
field is set automatically with the current system time.
type
is an unrestricted field: you can make up new message types and clients
will happily ignore them until someone implements support for them. Well
documented types include
{
type: 'chat/text',
content: {
text: 'whatever the user wants to say',
channel: 'some channel name. if it didnt exist before, it does now!'
}
}
AGPLv3
[5.1.2] - 2019-06-03
package-lock.json
(@hackergrrl).maxFeeds
default to 1024
in cabal.replicate()
(@hackergrrl)FAQs
p2p db functions for chat
The npm package cabal-core receives a total of 46 weekly downloads. As such, cabal-core popularity was classified as not popular.
We found that cabal-core demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.